mod_map = {"CTRL": 2, "SHIFT": 4, "WIN": 8, "ALT": 1}
mod_map_r = {2: 17, 4: 16, 8: 91, 1: 18}
vkcode_map = {
    "LBUTTON": 1,
    "RBUTTON": 2,
    "MBUTTON": 4,
    "F1": 112,
    "F2": 113,
    "F3": 114,
    "F4": 115,
    "F5": 116,
    "F6": 117,
    "F7": 118,
    "F8": 119,
    "F9": 120,
    "F10": 121,
    "F11": 122,
    "F12": 123,
    "A": 65,
    "B": 66,
    "C": 67,
    "D": 68,
    "E": 69,
    "F": 70,
    "G": 71,
    "H": 72,
    "I": 73,
    "J": 74,
    "K": 75,
    "L": 76,
    "M": 77,
    "N": 78,
    "O": 79,
    "P": 80,
    "Q": 81,
    "R": 82,
    "S": 83,
    "T": 84,
    "U": 85,
    "V": 86,
    "W": 87,
    "X": 88,
    "Y": 89,
    "Z": 90,
    "0": 48,
    "1": 49,
    "2": 50,
    "3": 51,
    "4": 52,
    "5": 53,
    "6": 54,
    "7": 55,
    "8": 56,
    "9": 57,
    "UP": 38,
    "DOWN": 40,
    "LEFT": 37,
    "RIGHT": 39,
    "PRIOR": 33,
    "NEXT": 34,
    "HOME": 36,
    "END": 35,
    "INSERT": 45,
    "RETURN": 13,
    "TAB": 9,
    "SPACE": 32,
    "BACKSPACE": 8,
    "DELETE": 46,
    "ESC": 27,
    "PAUSE": 19,
    "MULTIPLY": 106,
    "ADD": 107,
    "SEPARATOR": 108,
    "SUBTRACT": 109,
    "-": 189,
    "=": 187,
    ",": 188,
    ".": 190,
    "/": 191,
    "`": 192,
    ";": 186,
    "[": 219,
    "\\": 220,
    "]": 221,
    "'": 222,
    "DECIMAL": 110,
    "DIVIDE": 111,
    "NUMPAD0": 96,
    "NUMPAD1": 97,
    "NUMPAD2": 98,
    "NUMPAD3": 99,
    "NUMPAD4": 100,
    "NUMPAD5": 101,
    "NUMPAD6": 102,
    "NUMPAD7": 103,
    "NUMPAD8": 104,
    "NUMPAD9": 105,
    "F13": 124,
    "F14": 125,
    "F15": 126,
    "F16": 127,
    "F17": 128,
    "F18": 129,
    "F19": 130,
    "F20": 131,
    "F21": 132,
    "F22": 133,
    "F23": 134,
    "F24": 135,
    "CLEAR": 12,
    "ENTER": 13,
    "SHIFT": 16,
    "CTRL": 17,
    "ALT": 18,
    "CapsLock": 20,
    "SPACEBAR": 32,
    "PAGE_UP": 33,
    "PAGE_DOWN": 34,
    "LEFT_ARROW": 37,
    "UP_ARROW": 38,
    "RIGHT_ARROW": 39,
    "DOWN_ARROW": 40,
    "SELECT": 41,
    "PRINT": 42,
    "EXECUTE": 43,
    "PRINT_SCREEN": 44,
    "INS": 45,
    "DEL": 46,
    "HELP": 47,
    "NUMPAD_0": 96,
    "NUMPAD_1": 97,
    "NUMPAD_2": 98,
    "NUMPAD_3": 99,
    "NUMPAD_4": 100,
    "NUMPAD_5": 101,
    "NUMPAD_6": 102,
    "NUMPAD_7": 103,
    "NUMPAD_8": 104,
    "NUMPAD_9": 105,
    "MULTIPLY_KEY": 106,
    "ADD_KEY": 107,
    "SEPARATOR_KEY": 108,
    "SUBTRACT_KEY": 109,
    "DECIMAL_KEY": 110,
    "DIVIDE_KEY": 111,
    "NUM_LOCK": 144,
    "SCROLL_LOCK": 145,
    "LEFT_SHIFT": 160,
    "RIGHT_SHIFT ": 161,
    "LEFT_CONTROL": 162,
    "RIGHT_CONTROL": 163,
    "LEFT_MENU": 164,
    "RIGHT_MENU": 165,
    "BROWSER_BACK": 166,
    "BROWSER_FORWARD": 167,
    "BROWSER_REFRESH": 168,
    "BROWSER_STOP": 169,
    "BROWSER_SEARCH": 170,
    "BROWSER_FAVORITES": 171,
    "BROWSER_START_AND_HOME": 172,
    "VOLUME_MUTE": 173,
    "VOLUME_DOWN": 174,
    "VOLUME_UP": 175,
    "NEXT_TRACK": 176,
    "PREVIOUS_TRACK": 177,
    "STOP_MEDIA": 178,
    "PLAY/PAUSE_MEDIA": 179,
    "START_MAIL": 180,
    "SELECT_MEDIA": 181,
    "START_APPLICATION_1": 182,
    "START_APPLICATION_2": 183,
    "ATTN_KEY": 246,
    "CRSEL_KEY": 247,
    "EXSEL_KEY": 248,
    "PLAY_KEY": 250,
    "ZOOM_KEY": 251,
    "CLEAR_KEY": 254,
    "+": 187,
}
